package com.example.demo.Controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;

@RestController
@RequestMapping("/user")
public class UserController {

    @RequestMapping("/login1")
    public int login1() {
        Object obj = null;
//        int num = 1/0;
//        System.out.println(num);
        System.out.println(obj.hashCode());
        return 1;
    }

    @RequestMapping("/login2")
    public int login2() {
        Object obj = null;
        int num = 1/0;
        System.out.println(num);
        System.out.println(obj.hashCode());
        return 1;
    }

    @RequestMapping("/reg")
    public HashMap<String, Object> reg() {
        HashMap<String, Object> result = new HashMap<>();
        result.put("code", 200);
        result.put("data", 1);
        result.put("msg", "");
        return result;
    }

    @RequestMapping("/sayhi")
    public String sayhi() {
        return "sayhi";
    }
}
